home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 35
/
Amiga Format AFCD35 (Issue 119, Jan 1999).iso
/
-screenplay-
/
hd_installers
/
civilization
/
install_civilization
< prev
next >
Wrap
Text File
|
1998-11-09
|
4KB
|
195 lines
; Replacement hard drive installer for Civilization (ECS). V1.0.
; Copyright © 1998 Neil Cafferkey.
; $VER: "Install Civilization" 1.0 (2.11.98)
; Set constants
(set #extra-dir-name "exe")
(set #read-me-name "Read Me")
(set #generic-disk-name "CIV%ld")
(set #generic-disk-desc "Disk %s")
(set #disk-count 4)
(set #kick-too-low-msg "Kickstart 2.0 or greater is required.")
(set #askdir-prompt
(cat "Where should %s be installed?\nA drawer called \"%s\" will be"
" created within the selected location."
)
)
(set #dest-exists-msg "\"%s\" already exists.")
(set #ask-deprotect-prompt
"Do you want to remove the copy protection?"
)
(set #ask-deprotect-help
(cat "If you select `Yes' you'll avoid having to look up the"
" requirements for a civilisation advance in the manual."
)
)
(set #askdisk-prompt "Please insert %s in any drive")
(set #askdisk-help
(cat "Put %s into one of your floppy disk drives if you want to"
" continue."
)
)
(set #no-deprotect-msg "The copy protection could not be removed.")
; Check Kickstart version
(if (< (/ (getversion) 65536) 36)
(abort #kick-too-low-msg)
)
; Ask where to install to
(set #default-dest
(tackon
(askdir
(prompt (#askdir-prompt @app-name @app-name))
(default @default-dest)
(help @askdir-help)
(disk)
)
@app-name
)
)
(set @default-dest #default-dest)
; Check that destination directory doesn't already exist and create it
(if (OR (exists @default-dest) (exists (cat @default-dest ".info")))
(abort (#dest-exists-msg @default-dest))
(
(makedir @default-dest (infos))
(makedir (tackon @default-dest #extra-dir-name))
(onerror
(run
("Delete \"%s\" \"%s\" ALL FORCE"
@default-dest (cat @default-dest ".info")
)
)
)
)
)
; Ask whether the user wants to deprotect the game
(set #deprotect
(if (= 0 (run "Which Change" (safe)))
(askbool (prompt #ask-deprotect-prompt) (help #ask-deprotect-help))
0
)
)
; Copy icons
(copyfiles
(source "hidden")
(dest @default-dest)
(all)
(nogauge)
(help @copyfiles-help)
)
; Create startup-script
(textfile
(dest (tackon @default-dest @app-name))
(append "failat 20\n")
(set #i 0)
(while (< #i #disk-count)
(set #disk-name (#generic-disk-name (+ #i 1)))
(append ("Assign \"%s:\" \"%s\"\n" #disk-name #extra-dir-name))
(set #i (+ #i 1))
)
(append
(cat "Assign \"FONTS:\" \"fonts\" ADD\n"
("CD \"%s\"\ngame\nCD \"/\"\n" #extra-dir-name)
"Assign \"FONTS:\" \"fonts\" REMOVE\n"
)
)
(while (> #i 0)
(set #i (- #i 1))
(set #disk-name (#generic-disk-name (+ #i 1)))
(append ("Assign \"%s:\" REMOVE\n" #disk-name))
)
)
; Give script permission to startup-script
(protect (tackon @default-dest @app-name) "+s -e")
; Copy files from each disk
(set #i 0)
(while (< #i #disk-count)
(set #disk-name (#generic-disk-name (+ #i 1)))
(set #disk-desc (#generic-disk-desc (select #i "A" "B" "C" "D")))
(askdisk
(dest #disk-name)
(prompt (#askdisk-prompt #disk-desc))
(help (#askdisk-help ("%s %s" @app-name #disk-desc)))
)
(if (= (+ #i 1) 1)
(copyfiles
(source (cat #disk-name ":"))
(dest @default-dest)
(pattern "(fonts|readme.doc)")
(help @copyfiles-help)
)
)
(copyfiles
(source (cat #disk-name ":"))
(dest (tackon @default-dest #extra-dir-name))
(pattern
(select #i
"~(readme.doc|rinstall|#?.info)"
"([abcfghilmnrw]|el|sad.|sal|sh|st)#?"
"(ba|he|k|nu|sl|wi)#?"
"(ad|ci|di|er|fa|hi|in|lo|nuke1|po|pr|ri|se|sp257|wo)#?"
)
)
(files)
(help @copyfiles-help)
)
(set #i (+ #i 1))
)
; Remove copy protection
(if (AND (NOT @pretend) #deprotect)
(if
(<> 0
(run
("Change \"%s\" \"%s\""
(tackon @default-dest (tackon #extra-dir-name "game"))
"game.change"
)
)
)
(message #no-deprotect-msg)
)
)
; Change name of `readme.doc'
(rename
(tackon @default-dest "readme.doc")
(tackon @default-dest #read-me-name)
)